package com.imooc.user.exception;

import com.imooc.pojo.IMOOCJSONResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException;

/**
 * @author 顾志杰
 * @date 2020/8/31-9:35
 */
@RestControllerAdvice
public class CustomException {

    @ExceptionHandler(MaxUploadSizeExceededException.class)
    public IMOOCJSONResult handlerMaxUploadFile(MaxUploadSizeExceededException maxUploadSizeExceededException){
        return IMOOCJSONResult.errorMsg("文件大小不能超过500KB");
    }
}
